CCES 2014 Analysis
*Not included here are stylistic changes (color, labels, size) or scale adjustments to the figures.  

Creating & Recoding Variables:
[reversing direction of variable indicating treatment group]
gen hw1treat=1 if HW1_treat==3
replace hw1treat=2 if HW1_treat==2
replace hw1treat=3 if HW1_treat==1
gen hw2treat=1 if HW2_treat==3
replace hw2treat=2 if HW2_treat==2
replace hw2treat=3 if HW2_treat==1
gen hw3treat=1 if HW3_treat==3
replace hw3treat=2 if HW3_treat==2
replace hw3treat=3 if HW3_treat==1

[reversing direction of main outcome variable indicating choice of own group]
gen neighborhoodrev=1 if neighborhood==0
replace neighborhoodrev=0 if neighborhood==1
gen jobrev=1 if job==0
replace jobrev=0 if job==1
gen candidaterev=1 if candidate==0
replace candidaterev=0 if candidate==1

[education]
gen educ2=0 if educ<=2
replace educ2=1 if educ>=3 & educ<=6

[race variable with 3 groups]
gen race2=race
replace race2=. if race>=4
replace race2=3 if hispanic==1

[race variable combining blacks & Latinos]
gen race3=race2
replace race3=2 if race2==3

Figure 5:
eststo neighborhood: proportion neighborhoodrev if hw1treat==1, over(race2) 
eststo job: proportion jobrev if hw2treat==1, over(race2) 
eststo candidate: proportion candidaterev if hw3treat==1, over(race2) 
coefplot neighborhood job candidate, vertical recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 

Figure 6:
eststo neighborhood: proportion neighborhoodrev if hw1treat==1, over(race3 educ2)
eststo job: proportion jobrev if hw2treat==1, over(race3 educ2)
eststo candidate: proportion candidaterev if hw3treat==1, over(race3 educ2)
coefplot neighborhood job candidate, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit)

Figure 7:
eststo neighborhood: proportion neighborhoodrev if race3==2, over(hw1treat educ2)
coefplot neighborhood, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph.gph"
eststo job: proportion jobrev if race3==2, over(hw2treat educ2)
coefplot job, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph1.gph"
eststo candidate: proportion candidaterev if race3==2, over(hw3treat educ2)
coefplot candidate, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph2.gph"
graph combine Graph Graph1 Graph2

Figure 8:
eststo neighborhood: proportion neighborhoodrev if race3==1, over(hw1treat educ2)
coefplot neighborhood, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph.gph"
eststo job: proportion jobrev if race3==1, over(hw2treat educ2)
coefplot job, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph1.gph"
eststo candidate: proportion candidaterev if race3==1, over(hw3treat educ2)
coefplot candidate, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph2.gph"
graph combine Graph Graph1 Graph2

Online Appendix 7:
[Blacks only]
eststo neighborhood: proportion neighborhoodrev if race2=2, over(hw1treat educ2)
coefplot neighborhood, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph.gph"
eststo job: proportion jobrev if race2=2, over(hw2treat educ2)
coefplot job, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph1.gph"
eststo candidate: proportion candidaterev if race2=2, over(hw3treat educ2)
coefplot candidate, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph2.gph"
graph combine Graph Graph1 Graph2

[Latinos only]
eststo neighborhood: proportion neighborhoodrev if race2=3, over(hw1treat educ2)
coefplot neighborhood, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph.gph"
eststo job: proportion jobrev if race2=3, over(hw2treat educ2)
coefplot job, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph1.gph"
eststo candidate: proportion candidaterev if race2=3, over(hw3treat educ2)
coefplot candidate, vertical  recast(bar) barwidth(0.19) fcolor(*.1) ciopts(recast(rcap)) citop citype(logit) 
graph save Graph "/Users/vesla/Desktop/Graph2.gph"
graph combine Graph Graph1 Graph2

Online Appendix 8: 
[Blacks & Latinos]
logit neighborhood i.hw1treat##c.faminc if race3==2
mcp faminc hw1treat, plotopts(scheme(sj))
graph save Graph3 "/Users/vesla/Desktop/Graph3.gph"
logit job i.hw2treat##c.faminc if race3==2
mcp faminc hw2treat, plotopts(scheme(sj))
graph save Graph4 "/Users/vesla/Desktop/Graph4.gph"
logit candidate i.hw3treat##c.faminc if race3==2
mcp faminc hw3treat, plotopts(scheme(sj))
graph save Graph5 "/Users/vesla/Desktop/Graph5.gph"
graph combine Graph3 Graph4 Graph5

[Whites]
logit neighborhood i.hw1treat##c.faminc if race3==1
mcp faminc hw1treat, plotopts(scheme(sj))
graph save Graph6 "/Users/vesla/Desktop/Graph6.gph"
logit job i.hw2treat##c.faminc if race3==1
mcp faminc hw2treat, plotopts(scheme(sj))
graph save Graph7 "/Users/vesla/Desktop/Graph7.gph"
logit candidate i.hw3treat##c.faminc if race3==1
mcp faminc hw3treat, plotopts(scheme(sj))
graph save Graph8 "/Users/vesla/Desktop/Graph8.gph"
graph combine Graph6 Graph7 Graph8



